apps: add git flags to create/update/deploy - #6371
Merged
Merged
Conversation
The apps create/update/deploy commands accept a git repository and git deployment source, but the code generator emits these nested objects as `// TODO: complex arg` so they were only reachable via --json. Add ergonomic top-level flags for the GA git fields: - create/update: --git-url, --git-provider (App.GitRepository) - deploy: --git-branch, --git-tag, --git-commit, --git-source-code-path (AppDeployment.GitSource) The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract: url and provider must be set together; branch/tag/commit are mutually exclusive; source-code-path requires a ref. Co-authored-by: Isaac
golangci-lint's perfsprint linter flags fmt.Errorf with a static string and no format verbs. Both git flag validation errors are constant strings, so switch them to errors.New. Co-authored-by: Isaac
deployment_source is a proto oneof: an app deployment draws its code from either a workspace path (--source-code-path) or a Git source, not both. Reject the combination in the deploy git-source PreRunE so we don't build a request the server and bundle validation treat as invalid. Addresses review feedback from @atilafassina on #6182. Co-authored-by: Isaac
Collaborator
Integration test reportCommit: 92eb235
Top 3 slowest tests (at least 2 minutes):
|
atilafassina
approved these changes
Aug 24, 2026
The apps update usage now lists --git-url and --git-provider, so refresh the cmd/workspace/apps acceptance output.txt to match. Co-authored-by: Isaac
pietern
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Add ergonomic top-level flags for the GA git fields on the apps commands, which the code generator emits as
// TODO: complex arg(so today they are only reachable via--json):create/update:--git-url,--git-provider(App.GitRepository)deploy:--git-branch,--git-tag,--git-commit,--git-source-code-path(AppDeployment.GitSource)Why
The git repository and git deployment source are nested objects, so the generator skips flag generation for them. Users could only configure git-based app deployment by hand-writing JSON. These flags follow the command-overrides pattern (same approach as
clusters/overrides.go).The nested SDK pointers stay nil unless a git flag is set, so non-git requests are unchanged. Validation matches the API contract:
--git-urland--git-providermust be set together.--git-branch/--git-tag/--git-commitare mutually exclusive (proto oneof).--git-source-code-pathrequires a ref.deployment_sourceis a oneof, so the workspace--source-code-pathcannot be combined with the--git-*flags.Tests
Unit tests in
git_flags_test.gocover happy paths and each validation rule. Verified locally:go build,go test, andgolangci-lintall pass.Supersedes #6182 (which was opened from a fork and could not run CI). Incorporates review feedback from @atilafassina on that PR (the workspace-vs-Git mutual-exclusion check).
This pull request and its description were written by Isaac.